import React, { PureComponent } from 'react'
import Cart from './pages/Cart'

export class App extends PureComponent {
  constructor() {
    super()

    this.state = {
      isLogin: false
    }
  }

  login() {
    localStorage.setItem('token',431515)
    this.setState({ isLogin:true })
  }

  render() {
    const { isLogin } = this.state
    return (
      <div>
        <button onClick={() => this.login()}>登录</button>
        <Cart></Cart>
      </div>
    )
  }
}

export default App